The home page atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt
Use this file to discover all available pages before exploring further.
/ is the main entry point for readers. It is a Next.js server component that fetches all data from Supabase at build time and revalidates every 60 seconds using Incremental Static Regeneration (ISR).
src/app/(public)/page.tsx
Data flow
Each request cycle follows this path:Supabase queries run on the server
The page component runs five parallel (or sequential) Supabase queries: featured articles for the carousel, all categories and their latest articles, popular articles this week, trending articles in the last 24 hours, and active ads.
RPCs resolve ranked lists
The
popular_articles_this_week and trending_articles_24h RPCs return ranked article IDs. The page then fetches full article details for those IDs and re-sorts them to preserve the ranking order.Server component renders HTML
All data is passed as props to client components (
HeroCarousel, TrendingSection, SidebarPublic, AdBanner, CategorySection). The server sends fully-rendered HTML — no client-side data fetching on page load.Hero carousel
The carousel appears at the top of the page and showcases the most important articles. Data source: The page first queries for articles wherefeatured = true, ordered by created_at descending, limited to 5.
src/app/(public)/page.tsx
src/app/(public)/page.tsx
HeroCarousel is a client component that auto-advances every 6 seconds (INTERVAL_MS = 6000), pauses on hover, and renders previous/next arrow buttons and dot indicators. A thin red progress bar animates along the bottom of each slide.
Each slide is a full-bleed image with a gradient overlay at the bottom. It displays the category badge, article title, excerpt (hidden on mobile), and publication date. The entire slide is a <Link> pointing to /noticia/{slug}.
Trending section
Below the carousel, a “Tendencias del día” (Trending today) strip shows up to 5 articles that received the most page views in the last 24 hours. Data source: Thetrending_articles_24h RPC returns ranked article IDs. The page fetches full details and re-sorts by rank.
src/app/(public)/page.tsx
TrendingSection component renders a 5-column grid (stacked on mobile). Each card shows a thumbnail, a numbered rank badge, the category name in the category color, and the article title.
Category sections
Below trending, all categories are rendered in a 2/3 + 1/3 grid layout.src/app/(public)/page.tsx
CategorySection shows the category name (with its color accent bar), a “Ver más” link to the full category page (/{slug}), and up to 3 recent articles from that category.
Sidebar
The sticky right sidebar (SidebarPublic) contains three elements in order:
- Search box — a
<form>that submits to/buscar?q={query}. - First sidebar ad — rendered via
AdBannerif asidebar-position ad is active. - Most read this week — a ranked list of up to 5 articles from
popular_articles_this_week. Each entry shows a large rank number alongside a small article card. - Additional sidebar ads — any remaining
sidebar-position ads rendered after the popular list.
src/app/(public)/page.tsx
views count.
Ad placements
Ads are fetched from theads table filtered by active = true and sorted by sort_order.
src/app/(public)/page.tsx
Header banner
Rendered at the very top of the page, above the hero carousel. Supports multiple header ads stacked vertically.
Sidebar ads
Rendered inside
SidebarPublic. The first ad appears above the popular list; additional ads appear below it.Between-article ads
One
between_articles ad is injected after each category section in the main column, indexed by category position.AdBanner renders a clickable image that links to link_url. Clicking opens the link in a new tab.
If no ads are configured or all ads are inactive, the ad slots are simply hidden — no empty space is left in the layout.
